package string;

public class MatchesDemo {
    public static void main(String[] args) {
        String str = "我去";

        boolean matches = str.matches("我[去草]");
        System.out.println(matches);

        str = "我来";
        matches = str.matches("我[去草]");
        System.out.println(matches);

    }
}
